{% extends 'student/student_base.html' %}

{% block title %}
选课管理
{% endblock title %}
 {% block studentContent%}
 

 {% if courses %}
   
<div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">选课表</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                <form action="{% url 'studentSelectCourse' %}" method="post">
                                      {% if message %}
                                          <div class="alert alert-warning">{{ message }}</div>
                                       {% endif %}
            
                                   {% csrf_token %}
  									<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
								     <thead>
                                            <tr>
                                            	<th></th>
                                                <th>序号</th>
                                                <th>选课编号</th>
                                                <th>课程编号</th>
                                                <th>课程名称</th>
                                                <th>所属学院</th>
                                                <th>教师姓名</th>
                                                <th>上课教室</th>
                                                <th>上课时间</th>
                                                <th>学分</th>
                                                <th>已选人数</th>
                                             
                                            </tr>
                                        </thead>
										<tbody>
											    	
									        {% for course in courses %}
                                             
                                            <tr>
                                            	<td>  <input type="checkbox" class="action-select"  name="check_box_list" value={{course.selectCourseID}} /></td>
                                                <td>{{ forloop.counter }}</td>
                                                <td>{{ course.selectCourseID }}</td>
                                                <td>{{ course.selectCourses }}</td>
                                                <td>{{ course.selectCourseName  }}</td>
                                                <td>{{ course.selectCourses.courseInstitute}}</td>
                                                <td>{{ course.selectCoursTeacherName }}</td>
                                                <td>{{ course.selectCourseClassroom }}</td>
                                                <td>{{ course.selectCourseClassTime }}</td>
                                                <td>{{ course.selectCourses.courseCredit }}</td>
                                                <td>{{ course.selectCourseNum }}/{{ course.selectCourseAllNum }}</td>
                                              
                                            </tr>
                             
                                           {% endfor %}
										</tbody>

									</table>
							
									 <button type="submit" class="btn btn-primary">确定提交</button>
								</form>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
</div>
       {% else %}
        <h2>未开放选课</h2>
{% endif %}

{% if selectedcourses %}
<div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">退课表</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12">
                                <form action="{% url 'studentDeleteCourse' %}" method="post">
                                   {% csrf_token %}
                                    <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
                                     <thead>
                                            <tr>
                                                <th></th>
                                                <th>序号</th>
                                                <th>选课编号</th>
                                                <th>课程编号</th>
                                                <th>课程名称</th>
                                                <th>所属学院</th>
                                                <th>教师姓名</th>
                                                <th>上课教室</th>
                                                <th>上课时间</th>
                                                <th>学分</th>
                                                <th>已选人数</th>
                                             
                                            </tr>
                                        </thead>
                                        <tbody>
                                                    
                                            {% for selectedcourse in selectedcourses %}
                                             
                                            <tr>
                                                <td>  <input type="checkbox" class="action-select"  name="check_box_list2" value={{selectedcourse.selectCourseID}} /></td>
                                                <td>{{ forloop.counter }}</td>
                                                <td>{{ selectedcourse.selectCourseID }}</td>
                                                <td>{{ selectedcourse.selectCourses }}</td>
                                                <td>{{ selectedcourse.selectCourseName  }}</td>
                                                <td>{{ selectedcourse.selectCourses.courseInstitute}}</td>
                                                <td>{{ selectedcourse.selectCoursTeacherName }}</td>
                                                <td>{{ selectedcourse.selectCourseClassroom }}</td>
                                                <td>{{ selectedcourse.selectCourseClassTime }}</td>
                                                <td>{{ selectedcourse.selectCourses.courseCredit }}</td>
                                                <td>{{ selectedcourse.selectCourseNum }}/{{ selectedcourse.selectCourseAllNum }}</td>
                                              
                                            </tr>
                             
                                           {% endfor %}
                                        </tbody>

                                    </table>
                            
                                     <button type="submit" class="btn btn-primary">确定提交</button>
                                </form>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
</div>
       {% else %}
        <h4>未选课</h4>
{% endif %}
 {% endblock studentContent %}